/*
    n行m列，Ai取第i行最小值，Bj取第j列最大值
    想不出来递推和数学，打暴力了。。。。
*/

#include <algorithm>
#include <iostream>
#include <limits>
#include <set>
#include <vector>

using std::cin, std::cout;
using ull = unsigned long long;
using ui = unsigned int;

static constexpr size_t MAX_N {(size_t)1e3+5};
static constexpr ull MOD {998244353};
static size_t n,m,k;
ull mtx[MAX_N][MAX_N];
std::set<std::pair<size_t,ull>> s;

template<class T>
std::ostream&operator<<(std::ostream &os,const std::vector<T> &v)noexcept{
    os<<"[";
    for(size_t i{0};i<v.size()-1;i++){
        os<<v[i]<<" ,";
    }
    cout<<v[v.size()-1]<<"]";
    return os;
}

template<class T>
size_t hashVector1(const std::vector<T>& vec) noexcept{
    size_t seed = 0;
    for (size_t i = 0; i < vec.size(); ++i) {
        // 结合元素的值和其索引来生成哈希
        seed ^= std::hash<T>()((vec[i]+i)*(i << 2)) + 0x9e3779b9 - ((vec[i]*(i<<32))<<4) + ((vec[i]+i)<<2);
    }
    return seed;
}

template<class T>
size_t hashVector2(const std::vector<T>& vec) noexcept{
    size_t seed = 0;
    for (size_t i = 0; i < vec.size(); ++i) {
        // 结合元素的值和其索引来生成哈希
        seed ^= std::hash<T>()((vec[i]+i)*(i << 3)) + MOD<<(i%32) - ((vec[i]*(i<<16))<<3) + ((vec[i]+i)<<3);
    }
    return seed;
}

void dfs(size_t x, size_t y){
    if(x>n){
        // cout<<"x:"<<x<<" y:"<<y<<'\n';
        std::vector<ull> v;
        v.reserve(n+m);
        for(size_t i=1;i<=n;i++){
            ull ai {std::numeric_limits<decltype(ai)>::max()};
            for(size_t j=1;j<=m;j++){
                ai = std::min(ai,mtx[i][j]);
            }
            v.push_back(ai);
        }
        for(size_t j {1};j<=m;j++){
            ull bj {std::numeric_limits<decltype(bj)>::min()};
            for(size_t i{1};i<=n;i++){
                bj = std::max(bj,mtx[i][j]);
            }
            v.push_back(bj);
        }
        // cout<<v<<"\n";
        // cout<<hashVector1(v)<<','<<hashVector2(v)<<'\n';
        s.insert({hashVector1(v),hashVector2(v)});
        return;
    }
    for(ull i{1};i<=k;i++){
        mtx[x][y]=i;
        if(y+1>m){
            dfs(x+1,1);
        }else{
            dfs(x,y+1);
        }
    }
}

int main(){
    cin>>n>>m>>k;
    dfs(1,1);
    cout<<s.size()%MOD<<'\n';
}